using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace BookingDB.Models.Mapping
{
    public class ShowTypeMap : EntityTypeConfiguration<EntityShowType>
    {
        public ShowTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.type)
                .HasMaxLength(30);

            this.Property(t => t.title)
                .HasMaxLength(50);

            this.Property(t => t.description)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ShowType");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.type).HasColumnName("type");
            this.Property(t => t.title).HasColumnName("title");
            this.Property(t => t.description).HasColumnName("description");
            this.Property(t => t.release).HasColumnName("release");
        }
    }
}
